/**
 * @Author @fiber-cloud
 * @Date 2025/6/26 10:52
 */

public class Student {
    public String name;
    public int age;

    public void setStudent(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void set(String s, int a){
        age = 2;
        name = s;
    }

    //不带参数的构造方法
    Student(){
        System.out.println("不带参数的构造方法");
    }
    
    public void print(){
        System.out.println(this.name + " " + this.age);
    }

    public static void main(String[] args) {
        Student s = new Student();
        s.setStudent("John Smith", 18);
        s.print();
        s.set("John Smith", 18);
        s.print();
    }
}

